﻿<li class="collapsable" id="li0">
    <input id="cbx0" type="checkbox" class="cbxFunctionParent" /><span class="spNameFunctionParent"
        style="cursor: pointer; font-weight: bold">Menu gốc</span>
    <ul style="list-style-position: inside">
        {#foreach $T.Items as functionParrent}
        <li class="collapsable" id="li{$T.functionParrent.Info.Id}" style="padding-bottom: 5px;
            padding-left: 20px; padding-top: 5px;font-weight: bold">
            <input id="cbx{$T.functionParrent.Info.Id}" type="checkbox" class="cbxFunctionParent" /><span
                class="spNameFunctionParent" style="cursor: pointer;">{$T.functionParrent.Info.Name}</span>
            [<a style="font-style: italic" id="aDeleteFunction" href="javascript:;">Xóa</a>]
            <ul class="visible" style="list-style-position: inside">
                {#foreach $T.functionParrent.Items as functionSub}
                <li id="li{$T.functionSub.Id}" style="padding-top: 5px; padding-left: 20px;font-weight: normal">
                    <input type="checkbox" class="cbxFunctionInRole" id="cbx{$T.functionSub.Id}" /><span>{$T.functionSub.Name}</span>
                    [<a style="font-style: italic;" id="aDeleteFunction" href="javascript:;">Xóa</a>]
                    (
                     {#if (($T.functionSub.Permission & 8) == 8) }
                    <input type="checkbox" id="cbxPermissionView{$T.functionSub.Id}" checked="checked"/><span>Xem</span>
                     {#else}
                    <input type="checkbox" id="cbxPermissionView{$T.functionSub.Id}" /><span>Xem</span>
                     {#/if}

                     {#if (($T.functionSub.Permission & 4) == 4) }
                    <input type="checkbox" id="cbxPermissionAdd{$T.functionSub.Id}" checked="checked" /><span>Thêm</span>
                    {#else}
                    <input type="checkbox" id="cbxPermissionAdd{$T.functionSub.Id}" /><span>Thêm</span>
                    {#/if}

                    {#if (($T.functionSub.Permission & 2) == 2) }
                    <input type="checkbox" id="cbxPermissionEdit{$T.functionSub.Id}" checked="checked" /><span>Sửa</span>
                    {#else}
                    <input type="checkbox" id="cbxPermissionEdit{$T.functionSub.Id}" /><span>Sửa</span>
                    {#/if}

                    {#if (($T.functionSub.Permission & 1) == 1) }
                    <input type="checkbox" id="cbxPermissionDelete{$T.functionSub.Id}" checked="checked"/><span>Xóa</span>
                    {#else}
                    <input type="checkbox" id="cbxPermissionDelete{$T.functionSub.Id}" /><span>Xóa</span>
                    {#/if}
                    
                    <a style="font-style: italic;color:Green" id="aUpdatePermission" href="javascript:;"> - Cập nhật</a>
                    )
                </li>
                {#/for}
            </ul>
        </li>
        
        {#/for}
    </ul>
</li>
